package com.zyz.F_异常.练习2;

/**
 * @author: vick
 * @Date: 2025/3/18
 * @Description:
 * @version: 1.0
 */
public class BankAccount {
    private double balance;

    public BankAccount(double balance) {
        this.balance = balance;
    }

    public void withdraw(double account) {
        if (account > balance) {
            throw new BalanceException("余额不足，无法提取");
        }
        balance -= account;
    }

    public double getBalance() {
        return balance;
    }
}
